<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/view/system/common/headLogin.jsp"%>

<body>
	<div id="p" class="easyui-panel" title="角色详情"  style="padding: 10px; background: #fafafa;text-align:center;">
		<form id="roleAddForm" name="roleAddForm" method="post">
		
			<fieldset>
				<legend style="color: blue;font-size:1.5" >角色信息</legend>
				<table class="infoTable">
					<tr>
						<td style="width:25%;text-align:left" >
							角色名称 :
						</td>
						<td class="redText">${role.name}</td>
					</tr>
					<tr>
						<td style="width:25%;text-align:left;" >备注 :</td>
						<td>
							${role.descr}
						</td>
					</tr>
				</table>
			</fieldset>
			
			<table id="test" style="margin-top:10px;"></table>
			<div style="text-align:center;padding-top:10px;">
			
				<a  class="easyui-linkbutton myLink" iconCls="icon-undo"
					onclick="clearIframe()">关闭</a>
			</div>
		</form>
	</div>
</body>
<script>

$(function() {
	setTreeGridList();
});

function setTreeGridList() {
	$('#test').treegrid({
		title : '权限树',
		nowrap:false,hoverRowBackground:true,fitColumns:true,lines:true,rownumbers:true,singleSelect:true,fixed:true,animate:true,
		url : 'role/getMenuTreeListByRoleId.action?roleId=${role.id}',
		idField : 'id',
		treeField : 'name',
		tools: [{iconCls: 'icon-reload',handler: function(){$("#test").treegrid('reload');}}],
		columns:[[
			{field:'id',title:'ID',hidden:true},
			{field:'name',title:'名称',width:'80%',fix:true,
				formatter:function(value,rowData){
					if(rowData.level==4||rowData.level==5){
						if(rowData.type==1){
							return '<span style="color:blue">'+value+'</span>';
						} else {
							return '<span style="color:red">按钮:'+value+'</span>';
						}
					}
					return '<span style="color:gary">'+value+'</span>';
				}
			},{field:'descr',title:'权限描述',fix:true,width:'15%'
		}]]
	});
}

function clearIframe(){
    var el =  parent.window.document.getElementById('roleOperatorFrame');
    var iframe = el.contentWindow;
    if(el){
        el.src = 'about:blank';
        try{
            iframe.document.write('');
            iframe.document.clear();
        }catch(e){};
        parent.window.document.body.removeChild(el);
    }
}
</script>
</html>